package com.yuwei.mine

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.alibaba.android.arouter.facade.annotation.Route
import com.blankj.utilcode.util.ToastUtils
import com.yuwei.base.RoutePath
import com.yuwei.common.mvi.BaseViewActivity
import com.yuwei.mine.databinding.ActivityPermissionsBinding

@Route(path = RoutePath.MODULE_MINE_PERMISSIONS_ACTIVITY)
class PermissionsActivity : BaseViewActivity<ActivityPermissionsBinding>() {

    override fun initView() {
        binding.ivBack.setOnClickListener {
            finish()
        }
        binding.switchPermissions.setOnClickListener {
            if (binding.switchPermissions.isChecked){
                requestPermissions(
                    arrayOf(
                        "android.permission.CAMERA",
                        "android.permission.WRITE_EXTERNAL_STORAGE",
                        "android.permission.READ_EXTERNAL_STORAGE"
                    ),105
                )
                ToastUtils.showLong("已开启授权")
            }else{
                ToastUtils.showLong("已关闭授权")
            }
        }
    }

    override fun initData() {

    }
}